package com.productclass;

import java.io.IOException;
import java.io.PrintWriter;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.dao.CategroryDao;
import com.vo.Category;

public class ProductClass_modify_servlet_view extends HttpServlet {

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		response.setContentType("text/html,utf-8");
		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		int id = 0, idd = 0;
		String name = null;
		CategroryDao dao = new CategroryDao();
		List<Category> list = new ArrayList<Category>();
		Category category = new Category();
		HttpSession session = request.getSession();
		try {
			idd = Integer.parseInt(request.getParameter("idd"));
		} catch (Exception e) {
			// TODO: handle exception
		}
		try {
			
			list = dao.getAll();
		} catch (Exception e) {
			
			e.printStackTrace();
		}
		session.setAttribute("idd", idd);
		session.setAttribute("list", list);

		
		request.getRequestDispatcher("manage/productClass-modify.jsp").forward(request, response);
	}

	public void doPost(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		doGet(request, response);
	}

}
